import {createSlice} from '@reduxjs/toolkit'
import store from 'store2'
const appSlice = createSlice({
  name:'app',
  initialState:{
    collapsed:store.get('collapsed') === true
  },
  reducers:{
    setCollapsed(state,action){
      state.collapsed = action.payload
      store.set('collapsed',action.payload)
    }
  }
})
export const {setCollapsed} = appSlice.actions
export default appSlice.reducer